<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
use Illuminate\Routing\Router;


Route::group(['prefix'=>'admin','namespace'=>'Admin','middleware'=>'logs'],function(){
    Route::get('login','LoginController@login');
    Route::post('/generateCaptcha','LoginController@generateCaptcha');
    Route::post('check','LoginController@checkLogin');
    Route::get('/excel/export','ExcelController@export')->name('/excel/export');
});

Route::group(['prefix'=>'admin','namespace'=>'Admin','middleware'=>['checkLogin','logs']],function(Router $router){

    $router->get('logs','LogController@index');
    $router->get('logout','LoginController@logout');
    $router->get('index','IndexController@index');
    $router->get('home','IndexController@home');
    $router->post('statistics','IndexController@statistics');
    $router->resource('adminuser',AdminUserController::class);
    $router->resource('permission',PermissionController::class);
    $router->resource('role',RoleController::class);
    $router->post('setStatus','AdminUserController@setStatus');

    $router->get('order/orderLogs/{id?}','OrderController@orderLogs');


    $router->resource('agent',AgentController::class);
    $router->resource('dictionary',DictionaryController::class);

    $router->post('manager/passwordReset','ManagerController@passwordReset');
    $router->resource('manager',ManagerController::class);
    $router->get('manager/export/{ids?}','ManagerController@managerExport');

    $router->resource('order',OrderController::class);
    $router->get('order/export/{ids?}','OrderController@orderExport');//导出订单数据
    $router->any('product_status','ProductController@status'); //添加标签
    $router->post('getSecondCategory','ProductController@getSecondCategory'); //获取二级分类
    $router->post('getCategoryProduct','ProductController@getCategoryProduct'); //获取分类下产品
    $router->resource('product',ProductController::class);
    $router->resource('tag',TagController::class);
});


